home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / pluginy Firefox / 6584 / 6584.xpi / chrome / flashvideodownloader / content / send.js < prev   
Text File  |  2009-03-24  |  2KB  |  50 lines

  1. var FlashVDSend = {
  2.  
  3.     init : function()
  4.     {
  5.         document.getElementById('sending_url').value=window.arguments[0];
  6.     },
  7.     
  8.     send_url : function()
  9.     {
  10.             document.getElementById('sender_but').disabled=true;
  11.             document.getElementById('after_lbox').style.visibility="visible";
  12.             var httpRequest=false;
  13.             if (window.XMLHttpRequest){
  14.                 httpRequest = new XMLHttpRequest();
  15.                 if (httpRequest.overrideMimeType) {
  16.                     httpRequest.overrideMimeType('text/xml');
  17.                 }
  18.             }
  19.             if(!httpRequest){
  20.                 document.getElementById('sending_url').style.color="red";
  21.                 document.getElementById('loading_image').style.visibility="hidden";
  22.                 document.getElementById('after_loading_text').value="Some troubles.";
  23.                 return false;
  24.             }
  25.             
  26.             httpRequest.open("POST","http://www.flashvideodownloader.org/feedback/add_service.php");
  27.             httpRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  28.             httpRequest.onreadystatechange=function(){
  29.                 if (httpRequest.readyState == 4){
  30.                     if(httpRequest.status == 200){
  31.                         document.getElementById('sending_url').style.color="green";
  32.                         document.getElementById('loading_image').style.visibility="hidden";
  33.                         document.getElementById('after_loading_text').value="Thank you.";
  34.                     }else{
  35.                         document.getElementById('sending_url').style.color="red";
  36.                         document.getElementById('loading_image').style.visibility="hidden";
  37.                         document.getElementById('after_loading_text').value="Some troubles.";
  38.                     }
  39.                 }
  40.             };
  41.             httpRequest.send("adr="+window.arguments[0]);
  42.             
  43. //            var bro=window.opener.getBrowser();
  44. //            var tab=bro.addTab('http://www.flashvideodownloader.org/'+window.arguments[0]);
  45. //            bro.selectedTab = tab;
  46.  
  47.             return true;
  48.     }
  49.  
  50. }